#ifndef REUSABLEROTORDEF_H
#define REUSABLEROTORDEF_H

#include <Box2D/Box2D.h>

class ReusableRotorDef
{
public:
	ReusableRotorDef(
		bool collide,
		bool enableLimit, float leftLimit, float rightLimit,
		bool enableMotor, float motorForce, float motorSpeed );

	~ReusableRotorDef();

	inline bool IsCollisionEnabled() const { return m_jointDef->collideConnected; }
	inline void SetCollisionEnabled( bool enableCollision ) { m_jointDef->collideConnected = enableCollision; }

	inline bool IsLimitEnabled() const { return m_jointDef->enableLimit; }
	inline void SetLimitEnabled( bool enableLimit ) { m_jointDef->enableLimit = enableLimit; }

	inline float GetLeftLimit() const { return m_jointDef->upperAngle; }
	inline void SetLeftLimit( float leftLimit ) { m_jointDef->upperAngle = leftLimit; }

	inline float GetRightLeftLimit() const { return m_jointDef->lowerAngle; }
	inline void SetRightLimit( float rightLimit ) { m_jointDef->lowerAngle = rightLimit; }

	inline bool IsMotorEnabled() const { return m_jointDef->enableMotor; }
	inline void SetMotorEnabled( bool enableMotor ) { m_jointDef->enableMotor = enableMotor; }

	inline float GetMotorTorque() const { return m_jointDef->maxMotorTorque; }
	inline void SetMotorTorque( float torque ) { m_jointDef->maxMotorTorque = torque; }

	inline float GetMotorSpeed() const { return m_jointDef->motorSpeed; }
	inline void SetMotorSpeed( float speed ) { m_jointDef->motorSpeed = speed; }

	inline b2RevoluteJointDef* GetBox2dRevoluteJointDef() { return m_jointDef; }

private:
	b2RevoluteJointDef* m_jointDef;
};

#endif
